Skip to content

feat(audible): optional filter for other-language editions in search, BookDate and shelf sync - #352

Closed
Eyji wants to merge 1 commit into
kikootwo:mainfrom
Eyji:feat/259-language-filter
Closed

Eyji wants to merge 1 commit into
kikootwo:mainfrom
Eyji:feat/259-language-filter

Conversation

@Eyji

@Eyji Eyji commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #259

On a French store, keyword search also returns the English and Spanish editions. BookDate and shelf sync both keep the first search result, so BookDate recommended the English Six of Crows to me (there's no French audio edition) and accepting it created a request that can't be filled. Popular, new releases and categories come from the region's storefront and were fine, so I left them alone.

This adds an admin setting, audible.language_filter, off by default. It shows up as a checkbox under the Audible region in Settings > Library, for both Plex and Audiobookshelf. When it's on, AudibleService.search() drops products whose language fails isAcceptedLanguage() for the region and keeps the ones with no language at all. Callers opt in with { respectLanguageFilter: true }. The search page, BookDate's matchToAudnexus and shelf sync do; bulk import doesn't, since it has to match files already on disk.

A few details:

  • hasMore is now computed on the raw page, so a page where everything got filtered out doesn't end pagination.
  • PUT /api/admin/settings/audible accepts an optional boolean languageFilter. Leaving it out keeps the stored value, anything else is a 400. GET /api/admin/settings returns audibleLanguageFilter.
  • Shelf mappings resolved before the filter is turned on aren't looked up again. New misses become noMatch and get the usual 7-day retry.
  • The search page still hides the Load more bar when a whole page was filtered out, even with hasMore true. That only happens on queries in another language, and I didn't want to touch the search page in this PR.
  • Saving the Library tab still queues an audible_refresh when only the checkbox changed. Every save already did that.

Docs are updated in integrations/audible.md, settings-pages.md and features/bookdate.md. I moved the Audible settings route tests into their own file so admin-settings-core.routes.test.ts stays under 400 lines. audible.service.ts and bookdate/helpers.ts were already over the limit before this.

The full npm test passes (2640 tests), tsc --noEmit is clean and docker build -f dockerfile.unified . builds. I haven't run a full instance, so there's no screenshot. It's a single checkbox under the region dropdown, styled like the "Trigger library scan after import" one.

… BookDate and shelf sync

Keyword search on the catalog API returns every language, so on a non-English
region search, BookDate and shelf sync can surface (and request) editions that
are not in the region's language.

New admin setting `audible.language_filter` (off by default), a checkbox under
the Audible region in Settings > Library. When on, `search()` drops products whose
language fails `isAcceptedLanguage()` for the region, for callers that pass
`respectLanguageFilter`. Bulk import does not, since it matches files on disk.

Refs kikootwo#259

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kikootwo

Copy link
Copy Markdown
Owner

Thanks for picking this up, and for coming with tests. I'm going through it alongside #259 and will reply here soon.

@kikootwo

kikootwo commented Nov 2, 2026

Copy link
Copy Markdown
Owner

@Eyji thanks for this. The language filter is in now as #527, built on your setting and toggle with you as co-author, and extended to series pages, watched series, the home page rows, BookDate and shelf sync. It's off by default and will be in the next release. Closing this one in favour of #527.

@kikootwo kikootwo closed this Nov 2, 2026
@kikootwo

kikootwo commented Nov 3, 2026

Copy link
Copy Markdown
Owner

@Eyji this is out in v1.2.13, landed in #527: https://github.com/kikootwo/ReadMeABook/releases/tag/v1.2.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Admin-configurable language filter for Search, BookDate, and Popular results

2 participants